package com.gjy.util.sb.controller;

import com.gjy.util.sb.advice.DomainRequest;
import com.gjy.util.sb.entity.AjaxResult;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;

/**
 * @author 宫静雨
 * @version 1.0
 * @since 2023-10-23 15:01:45
 */
@RequestMapping("/advice")
@RestController
public class AdviceController {

    private static final Logger log = LoggerFactory.getLogger(AdviceController.class);

    @GetMapping("/d2")
    public AjaxResult d2(@RequestParam Integer code) {
        AjaxResult r = new AjaxResult();
        r.setCode(code);
        int i = 1 / 0;
        return r;
    }

    @PostMapping("/d1")
    public DomainRequest d1(@RequestBody DomainRequest request) {
        log.info("request: {}", request);
        return request;
    }
}
